<%-- 
    Document   : gerertaches
    Created on : 28 f�vr. 2012, 11:36:43
    Author     : tidiane
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<head>
   <title>Java Script Calender Date Picker</title>
   <meta http-equiv="Content-Type" content="text/html;">
   <script language="javaScript" type="text/javascript" src="media/js/calendar.js"></script>
   <link href="media/css/calendar.css" rel="stylesheet" type="text/css">
   <link rel = "stylesheet" href = "libs/bootstrap/css/bootstrap.css"/>
</head>

    <!-- Calender Script  --> 

    <table id="calenderTable">
        <tbody id="calenderTableHead">
          <tr>
            <td colspan="4" align="center">
	          <select onChange="showCalenderBody(createCalender(document.getElementById('selectYear').value,
	           this.selectedIndex, false));" id="selectMonth">
	              <option value="0">Jan</option>
	              <option value="1">Feb</option>
	              <option value="2">Mar</option>
	              <option value="3">Apr</option>
	              <option value="4">May</option>
	              <option value="5">Jun</option>
	              <option value="6">Jul</option>
	              <option value="7">Aug</option>
	              <option value="8">Sep</option>
	              <option value="9">Oct</option>
	              <option value="10">Nov</option>
	              <option value="11">Dec</option>
	          </select>
            </td>
            <td colspan="2" align="center">
			    <select onChange="showCalenderBody(createCalender(this.value, 
				document.getElementById('selectMonth').selectedIndex, false));" id="selectYear">
				</select>
			</td>
            <td align="center">
			    <a href="#" onClick="closeCalender();"><font color="#003333" size="+1">X</font></a>
			</td>
		  </tr>
       </tbody>
       <tbody id="calenderTableDays">
         <tr style="">
           <td>Sun</td><td>Mon</td><td>Tue</td><td>Wed</td><td>Thu</td><td>Fri</td><td>Sat</td>
         </tr>
       </tbody>
       <tbody id="calender"></tbody>
    </table>

<!-- End Calender Script  --> 
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
            <link rel ="stylesheet" type ="text/css" href = "libs/bootstrap/css/bootstrap.css" />
            <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js">
            </script>
            <script type = "text/javascript" src = "http://twitter.github.com/bootstrap/assets/js/bootstrap-modal.js" ></script>
            <script type = "text/javascript">
                $(document).ready(function (){
                    $("#edit-tache").click(function (){
                        if ($("#collaborateur").val() != "" && $("#libelle").val() != "" && $("#datum1").val() != "" && $("#datum2").val() != "" ){
                            alert (" Mise en test !! ");
                            $('#modifier-tache').submit();
                        } 
                        else{
                            alert (" Donnez les informations d'tache ! ");
                        }
                    })
                })
            </script>
    </head>
    <body>
        <div id="creertaches" >
        <div class="modal-header">
            <a class="close" data-dismiss="modal" >&times;</a>
            <h3>
                Mise à jour de la tâche
            </h3>
        </div>
        <div class="modal-body" >
            <form id ="modifier-tache" method = "POST" action = "modifier-tache" class="form-horizontal">
                <fieldset>

                <div class="control-group">
                    <label class="control-label" for="collaborateur"> Collaborateur </label>
                    <div class="controls">
                    <select class="input-xlarge" id="collaborateur" name ="collaborateur">
                        <c:forEach var = "collaborateur" items = "${collaborateurs}">
                            <option value = "${collaborateur.login}">${collaborateur.login}</option>
                        </c:forEach>
                    </select>
                    </div>
                </div>/modifier-tache
                    
                <div class="control-group">
                    <label class="control-label" for = "libelle"> Nom du tache </label>
                    <div class="controls">
                    <input type="text" class="input-xlarge" id = "titre" name ="libelle" value ="${tache.libelle}">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="textarea">Description</label>
                    <div class="controls">
                    <textarea class="input-xlarge" id="description" name ="description" rows="4">${tache.description}</textarea>
                    </div>
                </div>
                    
                <div class="control-group">
                <label class="control-label" for="titre" > Date Debut </label>
                <div class ="controls">
                    <input type="text" name="datum1" value ="${tache.dateDebut}"><a href="#" onClick="setYears(1947, 2015);
				showCalender(this, 'datum1');">
				<img src="media/images/calender.png"></a>
                 </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="datum2"> Date Fin </label>
                    <div class ="controls">
                        <input type="text" name="datum2"  value ="${tache.dateFin}"><a href="#" onClick="setYears(1947, 2015);
                                    showCalender(this, 'datum2');">
                                    <img src="media/images/calender.png"></a>
                    </div>
                </div>
                </fieldset>
            </form>
        </div>
            <div class ="modal-footer">
                <input id = "edit-tache" class ="btn btn-primary" type="button" value = "Enregister">
            </div>
        </div>
    </body>
</html>